<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <%
        String path = request.getContextPath();
        String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <base href="<%=basePath%>">
<meta charset="utf-8">
<title>联硕培训--消防工程师培训</title>
<link href="css/index.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.11.0.min.js"></script>

<script>
    $(document).ready(function(e) {

        // 得到显示的栏目名称
        var stritem=$("#itemname").text();
        // 左侧栏目列表中，找到属性a等于要显示栏目名称的li，把该li的样式设置为currentStyle，其他的同级样式都去掉currentStyle
        $(".listLeft ul li[a='"+stritem+"']").addClass("currentStyle").siblings().removeClass("currentStyle");
    });
	
</script>
</head>

<body>
<div class="layout">
   <!-- 头部，包括LOGO和导航和BNNAER -->
<%@include file="header.jsp"%>
   
   <!-- 内容 -->
   <div class="inWid main">
        <div class="listLeft">
            <div class="weizhi"><span>您所在的位置：主页</span>><span id="itemname">${items.itemname}</span></div>

            <ul>
                <c:forEach items="${itemlist}" var="item">
                    <li a="${item.itemname}"><a href="FindAllWithPage?itemid=${item.id}">${item.itemname}</a></li>
                </c:forEach>

            </ul>
        </div>
        <!-- end of left -->
        <div class="listRight">
            <div class="listRightHead">${items.itemname}</div>
            <div class="wid listRightMain">
                <ul>
                    <c:forEach items="${pageBean.list}" var="article">
                        <li>
                            <div class="LR_title"><a href="ContentServlet?id=${article.id}">${article.title}</a><span>${article.tdate}</span></div>
                            <div class="wid LR_content"><a href="ContentServlet?id=${article.id}">${fn:substring(article.content,1,50)}...</a></div>
                        </li>
                    </c:forEach>

                </ul>
                <div class="fenye">
                    <span><a href="FindAllWithPage?pageNum=1&itemid=${items.id}">第一页</a> </span>
                    <c:choose>
                        <c:when test="${pageBean.pageNum==1}">
                           <span>上一页</span>
                        </c:when>
                        <c:otherwise>
                            <span><a href="FindAllWithPage?pageNum=${pageBean.pageNum-1}&itemid=${items.id}">上一页</a></span>
                        </c:otherwise>
                    </c:choose>
                    <c:choose>
                        <c:when test="${pageBean.pageNum==pageBean.totalPage}">
                            <span>下一页</span>
                        </c:when>
                        <c:otherwise>
                            <span><a href="FindAllWithPage?pageNum=${pageBean.pageNum+1}&itemid=${items.id}">下一页</a></span>
                        </c:otherwise>
                    </c:choose>


                    <span>第<input type="text" value="${pageBean.pageNum}" />页/共<a>${pageBean.totalPage}</a>页</span>
                    <span><a href="FindAllWithPage?pageNum=${pageBean.totalPage}&itemid=${items.id}">最后一页</a></span>
                </div>
            
            </div>
        </div>
        <!-- end of right -->
   </div>
   <!-- end of 内容 -->
   
   
   <!-- 版权所有-->
<%@include file="foot.jsp"%>
</div>
</body>
</html>
